<?php
/**
 * Created by PhpStorm.
 * User: sunbo
 * Date: 2019/7/8
 * Time: 4:02 PM
 */
namespace app\index\controller;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\Exception;
//  0 1 * * * php /var/www/html/token/think TV_DD_Command>>/var/www/html/token/runtime/tv_dd.log 2>&1
//  0 1 * * * php /data/frontend/web/think TV_DD_Command>>/data/frontend/web/runtime/tv_dd.log 2>&1
class TV_DD_Command extends Command
{
    protected function configure()
    {
        $this->setName('TV_DD_Command')
            ->setDescription('TV按天');
    }

    protected function execute(Input $input, Output $output)
    {
        $output->writeln('开始：'.date('Y-m-d H:i:s'));
        /*** 这里写计划任务列表集 START ***/
        $this->birthday($output);//发短信
        /*** 这里写计划任务列表集 END ***/
        $output->writeln('结束');

    }
    //获取当天生日的员工 发短信
    public function birthday($output)
    {
        try{
            $chain=new CoinBaseContorller();
            $chain->Insert_token_bill_dd_report();
            $output->writeln("完成");
        }catch (Exception $e){
            $output->writeln("定时任务用户升级和收益错误：".$e->getMessage());
        }

    }

}
